package com.gxa.service.goods.impl;


import com.gxa.dao.goods.GoodsOneTypeMapper;
import com.gxa.pojo.goods.GoodsOneType;
import com.gxa.pojo.goods.GoodsTwoType;
import com.gxa.service.goods.GoodsOneTypeService;
import com.gxa.util.SqlSessionFactoryUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;

public class GoodsOneTypeServiceimpl implements GoodsOneTypeService {
    SqlSessionFactory sqlSessionFactory = SqlSessionFactoryUtils.getSqlSessionFactory();
    SqlSession sqlSession = sqlSessionFactory.openSession(true);
    GoodsOneTypeMapper mapper = sqlSession.getMapper(GoodsOneTypeMapper.class);


    @Override
    public int insert(String onetypename) {
        int insert = mapper.insert(onetypename);
        sqlSession.commit();
        return insert;
    }

    @Override
    public List<GoodsOneType> select() {
        List<GoodsOneType> select = mapper.select();
        return select;
    }

    @Override
    public List<GoodsOneType> select1(int tid) {
        List<GoodsOneType> goodsOneType = mapper.select1(tid);
        return goodsOneType;
    }
}
